package com.qq.day02.work00;

public class Test2 {
    public static void main(String[] args) {
        Manager manager = new Manager("张晓强", "M001", "销售部", " 李小亮");
        manager.showMsg();
        Clerk clerk = new Clerk("李小亮", "C001", "销售部", " 张小强");
        clerk.showMsg();
    }
}

//员工类
abstract class Employee {
    private String name;//姓名
    private String workid;//工号
    private String dept;//部门

    public Employee() {
    }

    public Employee(String name, String workid, String dept) {
        this.name = name;
        this.workid = workid;
        this.dept = dept;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getWorkid() {
        return workid;
    }

    public void setWorkid(String workid) {
        this.workid = workid;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    abstract void showMsg();
}

//经理类
class Manager extends Employee {
    public String Clerk;//职员

    @Override
    void showMsg() {
        System.out.println("经理：工号为" + getWorkid() + "，名字为" + getName() + "，部门为" + getDept() + "，他的职工名字是" + getClerk());
    }

    public Manager() {
    }

    public Manager(String name, String workid, String dept, String clerk) {
        super(name, workid, dept);
        Clerk = clerk;
    }

    public String getClerk() {
        return Clerk;
    }

    public void setClerk(String clerk) {
        Clerk = clerk;
    }

}

//职工类
class Clerk extends Employee {
    @Override
    void showMsg() {
        System.out.println("职工：工号为" + getWorkid() + "，名字为" + getName() + "，部门为" + getDept() + "，他的经理名字是" + getManger());
    }

    public String Manger;//经理

    public Clerk() {

    }

    public Clerk(String manger) {
        Manger = manger;
    }

    public Clerk(String name, String workid, String dept, String manger) {
        super(name, workid, dept);
        Manger = manger;
    }

    public String getManger() {
        return Manger;
    }

    public void setManger(String manger) {
        Manger = manger;
    }
}